(component
  (type $ty-foo:shared-dependency/doc (;0;)
    (instance
      (type (;0;) (func))
      (export (;0;) "f1" (func (type 0)))
      (export (;1;) "f2" (func (type 0)))
      (export (;2;) "f3" (func (type 0)))
      (type (;1;) (func (result string)))
      (export (;3;) "g1" (func (type 1)))
      (export (;4;) "g2" (func (type 1)))
      (export (;5;) "g3" (func (type 1)))
    )
  )
  (import "foo:shared-dependency/doc" (instance $foo:shared-dependency/doc (;0;) (type $ty-foo:shared-dependency/doc)))
  (type $ty-foo:shared-dependency/types (;1;)
    (instance
      (type (;0;) u32)
      (export (;1;) "a-typedef" (type (eq 0)))
    )
  )
  (import "foo:shared-dependency/types" (instance $foo:shared-dependency/types (;1;) (type $ty-foo:shared-dependency/types)))
  (alias export $foo:shared-dependency/types "a-typedef" (type $a-typedef (;2;)))
  (type $ty-main-dep (;3;)
    (instance
      (alias outer 1 $a-typedef (type (;0;)))
      (export (;1;) "a-typedef" (type (eq 0)))
      (type (;2;) (func (result 1)))
      (export (;0;) "foo" (func (type 2)))
    )
  )
  (import "main-dep" (instance $main-dep (;2;) (type $ty-main-dep)))
  (alias export $foo:shared-dependency/types "a-typedef" (type $"#type4 a-typedef" (@name "a-typedef") (;4;)))
  (type $ty-adapter-dep (;5;)
    (instance
      (alias outer 1 $"#type4 a-typedef" (type (;0;)))
      (export (;1;) "a-typedef" (type (eq 0)))
      (type (;2;) (func (result 1)))
      (export (;0;) "foo" (func (type 2)))
    )
  )
  (import "adapter-dep" (instance $adapter-dep (;3;) (type $ty-adapter-dep)))
  (core module $main (;0;)
    (type (;0;) (func))
    (type (;1;) (func (param i32)))
    (type (;2;) (func (result i32)))
    (type (;3;) (func (param i32 i32 i32 i32) (result i32)))
    (import "foo:shared-dependency/doc" "f1" (func (;0;) (type 0)))
    (import "foo:shared-dependency/doc" "f2" (func (;1;) (type 0)))
    (import "foo:shared-dependency/doc" "g1" (func (;2;) (type 1)))
    (import "foo:shared-dependency/doc" "g2" (func (;3;) (type 1)))
    (import "old" "adapter-f1" (func (;4;) (type 0)))
    (import "main-dep" "foo" (func (;5;) (type 2)))
    (memory (;0;) 1)
    (export "memory" (memory 0))
    (export "cabi_realloc" (func 6))
    (func (;6;) (type 3) (param i32 i32 i32 i32) (result i32)
      unreachable
    )
    (@producers
      (processed-by "wit-component" "$CARGO_PKG_VERSION")
      (processed-by "my-fake-bindgen" "123.45")
    )
  )
  (core module $wit-component:adapter:old (;1;)
    (type (;0;) (func))
    (type (;1;) (func (param i32)))
    (type (;2;) (func (result i32)))
    (type (;3;) (func (param i32 i32 i32 i32) (result i32)))
    (import "foo:shared-dependency/doc" "f1" (func $f1 (;0;) (type 0)))
    (import "foo:shared-dependency/doc" "f3" (func $f3 (;1;) (type 0)))
    (import "foo:shared-dependency/doc" "g1" (func $g1 (;2;) (type 1)))
    (import "foo:shared-dependency/doc" "g3" (func $g3 (;3;) (type 1)))
    (import "adapter-dep" "foo" (func $foo (;4;) (type 2)))
    (export "adapter-f1" (func 5))
    (export "cabi_import_realloc" (func 6))
    (func (;5;) (type 0)
      call $f1
      call $f3
      i32.const 0
      call $g1
      i32.const 0
      call $g3
      call $foo
      drop
    )
    (func (;6;) (type 3) (param i32 i32 i32 i32) (result i32)
      unreachable
    )
  )
  (core module $wit-component-shim-module (;2;)
    (type (;0;) (func (param i32)))
    (type (;1;) (func))
    (table (;0;) 5 5 funcref)
    (export "0" (func $indirect-foo:shared-dependency/doc-g1))
    (export "1" (func $indirect-foo:shared-dependency/doc-g2))
    (export "2" (func $adapt-old-adapter-f1))
    (export "3" (func $"#func3 indirect-foo:shared-dependency/doc-g1"))
    (export "4" (func $indirect-foo:shared-dependency/doc-g3))
    (export "$imports" (table 0))
    (func $indirect-foo:shared-dependency/doc-g1 (;0;) (type 0) (param i32)
      local.get 0
      i32.const 0
      call_indirect (type 0)
    )
    (func $indirect-foo:shared-dependency/doc-g2 (;1;) (type 0) (param i32)
      local.get 0
      i32.const 1
      call_indirect (type 0)
    )
    (func $adapt-old-adapter-f1 (;2;) (type 1)
      i32.const 2
      call_indirect (type 1)
    )
    (func $"#func3 indirect-foo:shared-dependency/doc-g1" (@name "indirect-foo:shared-dependency/doc-g1") (;3;) (type 0) (param i32)
      local.get 0
      i32.const 3
      call_indirect (type 0)
    )
    (func $indirect-foo:shared-dependency/doc-g3 (;4;) (type 0) (param i32)
      local.get 0
      i32.const 4
      call_indirect (type 0)
    )
    (@producers
      (processed-by "wit-component" "$CARGO_PKG_VERSION")
    )
  )
  (core module $wit-component-fixup (;3;)
    (type (;0;) (func (param i32)))
    (type (;1;) (func))
    (import "" "0" (func (;0;) (type 0)))
    (import "" "1" (func (;1;) (type 0)))
    (import "" "2" (func (;2;) (type 1)))
    (import "" "3" (func (;3;) (type 0)))
    (import "" "4" (func (;4;) (type 0)))
    (import "" "$imports" (table (;0;) 5 5 funcref))
    (elem (;0;) (i32.const 0) func 0 1 2 3 4)
    (@producers
      (processed-by "wit-component" "$CARGO_PKG_VERSION")
    )
  )
  (core instance $wit-component-shim-instance (;0;) (instantiate $wit-component-shim-module))
  (alias export $foo:shared-dependency/doc "f1" (func $f1 (;0;)))
  (core func $f1 (;0;) (canon lower (func $f1)))
  (alias export $foo:shared-dependency/doc "f2" (func $f2 (;1;)))
  (core func $f2 (;1;) (canon lower (func $f2)))
  (alias core export $wit-component-shim-instance "0" (core func $indirect-foo:shared-dependency/doc-g1 (;2;)))
  (alias core export $wit-component-shim-instance "1" (core func $indirect-foo:shared-dependency/doc-g2 (;3;)))
  (core instance $foo:shared-dependency/doc (;1;)
    (export "f1" (func $f1))
    (export "f2" (func $f2))
    (export "g1" (func $indirect-foo:shared-dependency/doc-g1))
    (export "g2" (func $indirect-foo:shared-dependency/doc-g2))
  )
  (alias core export $wit-component-shim-instance "2" (core func $adapt-old-adapter-f1 (;4;)))
  (core instance $old (;2;)
    (export "adapter-f1" (func $adapt-old-adapter-f1))
  )
  (alias export $main-dep "foo" (func $foo (;2;)))
  (core func $foo (;5;) (canon lower (func $foo)))
  (core instance $main-dep (;3;)
    (export "foo" (func $foo))
  )
  (core instance $main (;4;) (instantiate $main
      (with "foo:shared-dependency/doc" (instance $foo:shared-dependency/doc))
      (with "old" (instance $old))
      (with "main-dep" (instance $main-dep))
    )
  )
  (alias core export $main "memory" (core memory $memory (;0;)))
  (alias export $foo:shared-dependency/doc "f1" (func $"#func3 f1" (@name "f1") (;3;)))
  (core func $"#core-func6 f1" (@name "f1") (;6;) (canon lower (func $"#func3 f1")))
  (alias export $foo:shared-dependency/doc "f3" (func $f3 (;4;)))
  (core func $f3 (;7;) (canon lower (func $f3)))
  (alias core export $wit-component-shim-instance "3" (core func $"#core-func8 indirect-foo:shared-dependency/doc-g1" (@name "indirect-foo:shared-dependency/doc-g1") (;8;)))
  (alias core export $wit-component-shim-instance "4" (core func $indirect-foo:shared-dependency/doc-g3 (;9;)))
  (core instance $"#core-instance5 foo:shared-dependency/doc" (@name "foo:shared-dependency/doc") (;5;)
    (export "f1" (func $"#core-func6 f1"))
    (export "f3" (func $f3))
    (export "g1" (func $"#core-func8 indirect-foo:shared-dependency/doc-g1"))
    (export "g3" (func $indirect-foo:shared-dependency/doc-g3))
  )
  (alias export $adapter-dep "foo" (func $"#func5 foo" (@name "foo") (;5;)))
  (core func $"#core-func10 foo" (@name "foo") (;10;) (canon lower (func $"#func5 foo")))
  (core instance $adapter-dep (;6;)
    (export "foo" (func $"#core-func10 foo"))
  )
  (core instance $"#core-instance7 old" (@name "old") (;7;) (instantiate $wit-component:adapter:old
      (with "foo:shared-dependency/doc" (instance $"#core-instance5 foo:shared-dependency/doc"))
      (with "adapter-dep" (instance $adapter-dep))
    )
  )
  (alias core export $wit-component-shim-instance "$imports" (core table $"shim table" (;0;)))
  (alias export $foo:shared-dependency/doc "g1" (func $g1 (;6;)))
  (alias core export $main "cabi_realloc" (core func $realloc (;11;)))
  (core func $"#core-func12 indirect-foo:shared-dependency/doc-g1" (@name "indirect-foo:shared-dependency/doc-g1") (;12;) (canon lower (func $g1) (memory $memory) (realloc $realloc) string-encoding=utf8))
  (alias export $foo:shared-dependency/doc "g2" (func $g2 (;7;)))
  (core func $"#core-func13 indirect-foo:shared-dependency/doc-g2" (@name "indirect-foo:shared-dependency/doc-g2") (;13;) (canon lower (func $g2) (memory $memory) (realloc $realloc) string-encoding=utf8))
  (alias core export $"#core-instance7 old" "adapter-f1" (core func $adapter-f1 (;14;)))
  (alias export $foo:shared-dependency/doc "g1" (func $"#func8 g1" (@name "g1") (;8;)))
  (alias core export $"#core-instance7 old" "cabi_import_realloc" (core func $"#core-func15 realloc" (@name "realloc") (;15;)))
  (core func $"#core-func16 indirect-foo:shared-dependency/doc-g1" (@name "indirect-foo:shared-dependency/doc-g1") (;16;) (canon lower (func $"#func8 g1") (memory $memory) (realloc $"#core-func15 realloc") string-encoding=utf8))
  (alias export $foo:shared-dependency/doc "g3" (func $g3 (;9;)))
  (core func $"#core-func17 indirect-foo:shared-dependency/doc-g3" (@name "indirect-foo:shared-dependency/doc-g3") (;17;) (canon lower (func $g3) (memory $memory) (realloc $"#core-func15 realloc") string-encoding=utf8))
  (core instance $fixup-args (;8;)
    (export "$imports" (table $"shim table"))
    (export "0" (func $"#core-func12 indirect-foo:shared-dependency/doc-g1"))
    (export "1" (func $"#core-func13 indirect-foo:shared-dependency/doc-g2"))
    (export "2" (func $adapter-f1))
    (export "3" (func $"#core-func16 indirect-foo:shared-dependency/doc-g1"))
    (export "4" (func $"#core-func17 indirect-foo:shared-dependency/doc-g3"))
  )
  (core instance $fixup (;9;) (instantiate $wit-component-fixup
      (with "" (instance $fixup-args))
    )
  )
  (@producers
    (processed-by "wit-component" "$CARGO_PKG_VERSION")
  )
)
